package com.euc.springbootframework.dao.base;

import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean;
import org.springframework.data.repository.core.support.RepositoryFactorySupport;

import java.io.Serializable;

public class BaseDaoFactoryBean <T extends BaseDao<S, ID>, S, ID extends Serializable>
        extends MongoRepositoryFactoryBean<BaseDao<S, ID>, S, ID> {


    public BaseDaoFactoryBean(Class<? extends BaseDao<S, ID>> repositoryInterface) {
        super(repositoryInterface);
    }

    @Override
    protected RepositoryFactorySupport getFactoryInstance(final MongoOperations operations) {
        return new BaseDaoFactory(operations);
    }
}
